import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import sys
from mpl_toolkits.mplot3d import Axes3D

try:
    dados = pd.read_csv(sys.argv[1])
except:
    print ("File not found " + sys.argv[1])
    sys.exit (0)


fig, ax1 = plt.subplots()
left, bottom, width, height = [0.5, 0.5, 0.35, 0.35]
ax2 = fig.add_axes([left, bottom, width, height])


chart = sns.histplot(ax = ax1, data=dados, x="Descendents", bins=15, log=True, shrink=0.9)

ax1.set_title ("Contagions per person",fontsize=20)

chart.set_xlabel("Descendents",fontsize=14)
chart.set_ylabel("Instances",fontsize=14)
ax1.tick_params(axis='both', which='major', labelsize=14)






sns.scatterplot(ax=ax2,data=dados, x='Age', y='Descendents') 
ax2.set_xlabel('Age',fontsize=11)
ax2.set_ylabel('Descendents',fontsize=11)
ax2.tick_params(axis='both', which='major', labelsize=11)



plt.draw()

plt.savefig('Figure-9a.eps', format='eps')
plt.savefig('Figure-9a.png', dpi=400)

plt.show ()

